<?php

function myMerge($arr1,$arr2)
{
	$n=0;
	$result = array();
	
	while(isset($arr1[$n]))
	{
		$result[]=$arr1[$n];
		$n++;
	}
	
	$n=0;
	while(isset($arr2[$n]))
	{
		$result[]=$arr2[$n];
		$n++;
	}
	
	return $result;
	
}

function myCombine($arr1,$arr2)
{
	$n=0;
	$result = array();
	
	while(isset($arr1[$n]))
	{
		if(!isset($arr2[$n]))
		$result[$arr1[$n]]=null;
		else
		$result[$arr1[$n]]=$arr2[$n];
		
		$n++;
	}
	
	return $result;
	
}






$a1 = array(1,2,3,4,5);
$a2 = array(6,7,8,9,10);

//$a3 = myMerge($a1, $a2);
$a3 = myCombine($a1, $a2);
echo'<pre>';
print_r($a1);
print_r($a2);
print_r($a3);

?>
<pre>
	
	function myCombine($arr1,$arr2)
{
	$n=0;
	$result = array();
	
	while(isset($arr1[$n]))
	{
		if(!isset($arr2[$n]))
		$result[$arr1[$n]]=null;
		else
		$result[$arr1[$n]]=$arr2[$n];
		
		$n++;
	}
	
	return $result;
	
}
</pre>
